package com.lam.common.validate.model;

import java.util.List;
import java.util.Map;

import com.lam.common.utils.StringUtils;

public class UniqueDesc {

	/** 唯一编码 */
    private String code;
    /** 表名 */
    private String tableName;
    /** 唯一字段,多个用逗号分隔 */
    private String uniqueField;
    /** 查询条件字段 */
    private String queryField;
    /** 查询条件 */
    private String conditionSql;
    
	private List<String> varList;
	
	private Map<String, Object> uniqueFieldMap;
	private Map<String, Object> queryFieldMap;
	private String exeConditionSql;
	
	public UniqueDesc() {}
	public UniqueDesc(String tableName, String uniqueField) {
		this(null, tableName, uniqueField, null, null);
	}
	public UniqueDesc(String tableName, String uniqueField, String queryField) {
		this(null, tableName, uniqueField, queryField, null);
	}
	public UniqueDesc(String tableName, String uniqueField, String queryField, String conditionSql) {
		this(null, tableName, uniqueField, queryField, conditionSql);
	}
	public UniqueDesc(String code, String tableName, String uniqueField, String queryField, String conditionSql) {
		this.code = code;
		this.tableName = tableName;
		this.uniqueField = uniqueField;
		this.queryField = queryField;
		this.conditionSql = conditionSql;
	}
	
	public boolean checkParam() {
		return StringUtils.isNoneBlank(tableName, uniqueField);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getUniqueField() {
		return uniqueField;
	}

	public void setUniqueField(String uniqueField) {
		this.uniqueField = uniqueField;
	}

	public String getQueryField() {
		return queryField;
	}

	public void setQueryField(String queryField) {
		this.queryField = queryField;
	}

	public String getConditionSql() {
		return conditionSql;
	}

	public void setConditionSql(String conditionSql) {
		this.conditionSql = conditionSql;
	}

	public List<String> getVarList() {
		return varList;
	}

	public void setVarList(List<String> varList) {
		this.varList = varList;
	}

	public Map<String, Object> getUniqueFieldMap() {
		return uniqueFieldMap;
	}

	public void setUniqueFieldMap(Map<String, Object> uniqueFieldMap) {
		this.uniqueFieldMap = uniqueFieldMap;
	}

	public Map<String, Object> getQueryFieldMap() {
		return queryFieldMap;
	}

	public void setQueryFieldMap(Map<String, Object> queryFieldMap) {
		this.queryFieldMap = queryFieldMap;
	}

	public String getExeConditionSql() {
		return exeConditionSql;
	}

	public void setExeConditionSql(String exeConditionSql) {
		this.exeConditionSql = exeConditionSql;
	}
    
}
